package com.rk.jarjuggler.gui;

import javax.swing.*;

import com.rk.jarjuggler.model.DirNode;
import com.rk.jarjuggler.service.DirFileStore;

public class TreePanel extends JPanel {
    private LibTreeModel treeModel;

    public TreePanel() {
        DirNode root = DirFileStore.loadTree();
        treeModel = new LibTreeModel(root);

        JTree tree = new JTree(treeModel);
        JScrollPane scrollPane = new JScrollPane(tree);
        add(scrollPane);
    }

    public static void main(String[] args) {
        TreePanel panel = new TreePanel();
        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        frame.add(panel);
        frame.pack();
        frame.setVisible(true);
    }
}
